// BaseGameEntity.cpp : 
//

#include "BaseGameEntity.h"
#include <map>

int BaseGameEntity::s_iNextValidID = 0;

void BaseGameEntity::SetID(int val)
{
	if (val >= s_iNextValidID)
	{
		m_ID = val;
		s_iNextValidID = val + 1;
	}
	else
		m_ID = s_iNextValidID++;
}

std::map<int, std::string> name_map;

std::string GetNameOfEntity(int id)
{
	std::map<int, std::string>::iterator iter = name_map.find(id);
	if (iter != name_map.end())
		return iter->second;
	else
		return "";
}

void AddNameOfEntity(int id, std::string name)
{
	name_map.insert(std::map<int, std::string>::value_type(id, name));
}